package com.hancher.common.base;

import android.app.Application;
import android.text.TextUtils;

import com.hancher.common.androidutil.ApkInfoUtil;
import com.hancher.plugins.hrlog.HrLogUtil;
import com.tencent.mmkv.MMKV;

/**
 * 作者：Hancher
 * 时间：2020/1/9.
 * 邮箱：ytu_shaoweijie@163.com
 * 版本：v1.0
 * <p>
 * 说明：
 */
public class BaseApplication extends Application {

    public static BaseApplication instance;

    public static BaseApplication getInstance() {
        return instance;
    }


    @Override
    public void onCreate() {
        super.onCreate();
        String processName = ApkInfoUtil.getProcessName(this);
        HrLogUtil.v("进程名:%s, debug版本:%s", processName, ApkInfoUtil.isApkInDebug(this));

        if (!TextUtils.isEmpty(processName) && !processName.contains(":")) {
            instance = this;
            MMKV.initialize(this);
        }
    }

}
